<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <script src="scripts/axios.min.js"></script>
    <script src="scripts/vue-2.6.13.js"></script>
</head>
<body>
    <div id="app">
        <input type="button" value="简单cors请求" id="btnSimple" @click="handleSimpleCors"/>
        <input type="button" value="复杂cors请求" id="btnComplex" @click="handleComplexCors"/>
    </div>
    
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                message: 'hello vue'
            },
            methods:{
                handleSimpleCors:function(){
                           
                    axios.get('http://localhost:8080/dept')
                        .then(function (response) {
                            console.log(response);
                        })
                },
                handleComplexCors:function(){
                    axios.delete('http://localhost:8080/dept')
                        .then(function (response) {
                            console.log(response);
                        })
                }
            }
        })


    </script>
</body>
</html>